<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>ajax测试</title>
    <script src="https://cdn.bootcss.com/jquery/3.3.1/jquery.min.js"></script>
    <script>
        $(document).ready(function () {
            $("button").click(function () {
                $.get("/loveweiwei",data, function (data,status) {
                    alert("数据: " + data + "\n状态: " + status)
                    //写实习其他功能的代码
                })
            })
        })
        // data 是http响应的数据
    </script>
    <script>
        $(document).ready(function () {
            $("#cali").blur(function () {
                $.get("/search", function (data) {
                    $(".zhang").html(data)
                })
            })
        })
    </script>
</head>
<body>
    <form method="get">
        <div style="margin-left: 400px">
            <p style="align-content: center"><h1>ajax使用案例</h1></p>
            <button>发送一个 HTTP GET 请求并获取返回结果</button>
            <input id="cali" type="text" placeholder="用户名" name="username" >
            <p>cali演示</p>
            <div class="zhang"></div>
        </div>
    </form>

</body>
</html>
